package com.hzz.mall.seckill.config;

import com.hzz.mall.seckill.interceptor.LoginUserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 胡忠智
 * @date 2022/1/8-23:52
 * @Description TODO
 */
@Configuration
public class SeckillWebConfig implements WebMvcConfigurer {

    @Override //拦截所有的路径
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginUserInterceptor()).addPathPatterns("/**");
    }

}
